package utils

import (
	"os"
	"os/exec"
	"path/filepath"
	"time"
)

func DeletePreMouthFile(dir string) {
	_ = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
		if time.Now().Sub(info.ModTime()) > time.Hour*24*30 {
			_ = exec.Command("rm", "-rf", filepath.Join(dir, path)).Run()
		}
		return nil
	})
}
